package com.wy._05Random.Enum;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;


public enum EnglishLetterEnum {
    //大写字母  到随机大写字母 在unicode中的编码是65-90 小写字母 97-122
    Capital_Letter(new UnicodeFragment("大写字母", 65, 90)),
    Lowercase_Letter(new UnicodeFragment("小写字母", 97, 122));
    private final UnicodeFragment unicodeFragment;

    private static final int count = Arrays.stream(values()).mapToInt(value -> value.getUnicodeFragment().getCount()).sum();

    private static final List<UnicodeFragment> unicodeFragmentList = Arrays.stream(values()).map(EnglishLetterEnum::getUnicodeFragment).collect(Collectors.toList());

    EnglishLetterEnum(UnicodeFragment unicodeFragment) {
        this.unicodeFragment = unicodeFragment;
    }

    public UnicodeFragment getUnicodeFragment() {
        return unicodeFragment;
    }

    public static int getCount() {
        return count;
    }

    public static List<UnicodeFragment> getUnicodeFragmentList() {
        return unicodeFragmentList;
    }
}
